package com.janko.springbootbase.juc.thread_basic;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author nyk
 * @Date 2023/2/22 10:24
 * @Version 1.0
 * @Desc executorService的使用
 */
public class ExecutorServiceExample {

    public static void main(String[] args) {
        SyncronizedExample example = new SyncronizedExample();
        SyncronizedExample example2 = new SyncronizedExample();
        ExecutorService service = Executors.newCachedThreadPool();
        service.execute(() -> example.func1());
        service.execute(() -> example2.func1());
    }
}
